package io.renren.modules.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.modules.order.dao.OrderDao;
import io.renren.modules.order.enity.OrderEntity;
import io.renren.modules.order.service.OrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service("OrderService")
public class OrderServiceImpl extends ServiceImpl<OrderDao, OrderEntity> implements OrderService {
    @Resource
    private OrderDao orderDao;

    @Override
    public Integer updateOrderStatus(String orderCode, Integer orderStatus) {
        UpdateWrapper<OrderEntity> updateWrapper=new UpdateWrapper<>();
        updateWrapper.eq("order_code",orderCode).set("order_status",orderStatus);
        return orderDao.update(null,updateWrapper);
    }
}
